using GMT
ns=15; x=linspace(0,2*pi,ns).+1; y=zeros(size(x)); z=-cos.(x); curve=[x[:] y[:] z[:]];
FV = revolve(curve)
viz(FV)
Revolve curves to build surfaces.
This function rotates the curve curve by the angle extent, in the direction defined by direction (:positive, :negative, :both), around the vector n, to build the output mesh defined as a Faces-Vertices type.
This function is a modified version on the revolvecurve function from the Comodo.jl package.
curve: A Mx3 matrix of points defining the curve to revolve. Each row is a point in 3D space.extent: The extent of the revolved curve in degrees. Default is 360 degrees. But a finer control is possible using the ang1 and ang2 arguments.
ang1: The starting angle in degrees. Use this if start and end angles do not define a full revolution.
ang2: The ending angle in degrees.
dir: The direction of the revolved curve (:positive, :negative, :both).
n: The normal vector of the revolved curve.
n_steps: The number of steps used to build the revolved curve. If 0 (the default) the number of steps is computed from the curve point spacing.
closed: If true (the default), close the revolved curve at the start and end slice.
type: The type of faces used to build the revolved curve (:quad (default), :tri).
A GMTfv FacesVertices object.
Create a surface by revolving a curve.